import javaService from '../javaHttp'
function handel(data) {
  var params = new URLSearchParams()
  for (const key in data) {
    params.append(key, data[key])
  }
  return params
}
// 保存考核项
export function Saveitem(data) {
  return javaService({
    url: `${process.env.VUE_APP_BEG_IP}xboot/hkFormIndex/save`,
    method: 'POST',
    data: handel(data)

  })
}
// 求考核项管理列表
export function getkaohelist(params) {
  return javaService({
	  url: `${process.env.VUE_APP_BEG_IP}xboot/hkFormIndex/getByCondition`,
    method: 'get',
	  params

  })
}
// 删除考核项
export function removeitem(ids) {
  return javaService({
	  url: `${process.env.VUE_APP_BEG_IP}xboot/hkFormIndex/delByIds/${ids}`,
    method: 'delete'

  })
}
// 搜索考核项
export function searchitem(params) {
  return javaService({
	  url: `${process.env.VUE_APP_BEG_IP}xboot/hkFormIndex/getByCondition`,
    method: 'get',
    params

  })
}
// 考核项按钮列表
export function getbtnall() {
  return javaService({
	  url: `${process.env.VUE_APP_BEG_IP}xboot/hkFormIndex/hkFormIndexAll`,
    method: 'get'

  })
}
// 保存为表单
export function savefrom(data) {
  return javaService({
	  url: `${process.env.VUE_APP_BEG_IP}xboot/hkFormEntity/save`,
    method: 'POST',
    data: handel(data)

  })
}
// 指标项列表
export function zhibiaolist(params) {
  return javaService({
	  url: `${process.env.VUE_APP_BEG_IP}xboot/hkAssessmentIndex/getByCondition`,
    method: 'get',
    params

  })
}

// 指标项搜索
export function zhibiaosousuo(params) {
  return javaService({
	  url: `${process.env.VUE_APP_BEG_IP}xboot/hkAssessmentIndex/getByCondition`,
    method: 'get',
    params

  })
}
// 指标项新增
export function zhibiaoadd(data) {
  return javaService({
	  url: `${process.env.VUE_APP_BEG_IP}xboot/hkAssessmentIndex/save`,
    method: 'post',
    data: handel(data)

  })
}
// 指标项删除
export function zhibiaodelete(ids) {
  return javaService({
	 url: `${process.env.VUE_APP_BEG_IP}xboot/hkAssessmentIndex/delByIds/${ids}`,
    method: 'delete'

  })
}
// 指标项修改
export function zhibiaochange(ids) {
  return javaService({
	 url: `${process.env.VUE_APP_BEG_IP}xboot/hkAssessmentIndex/get/${ids}`,
    method: 'get'

  })
}
// 指标项修改提交
export function zhibiaoupdata(data) {
  return javaService({
	  url: `${process.env.VUE_APP_BEG_IP}xboot/hkAssessmentIndex/updateIndex`,
    method: 'put',
    data: handel(data)

  })
}
// 表单分页
export function biaodanlist(params) {
  return javaService({
	 url: `${process.env.VUE_APP_BEG_IP}xboot/hkFormEntity/getByCondition`,
    method: 'get',
    params

  })
}

// 表单项编辑
export function frombianji(id) {
  return javaService({
	 url: `${process.env.VUE_APP_BEG_IP}xboot/hkFormEntity/getFormEntity/${id}`,
    method: 'get'

  })
}
// 表单删除
export function removefrom(ids) {
  return javaService({
	  url: `${process.env.VUE_APP_BEG_IP}xboot/hkFormEntity/delByIds/${ids}`,
    method: 'delete'

  })
}

// 表单搜索
export function fromsearch(params) {
  return javaService({
	  url: `${process.env.VUE_APP_BEG_IP}xboot/hkFormEntity/getByCondition`,
    method: 'get',
    params

  })
}
// 表单项关联指标项列表
export function guanlianitem() {
  return javaService({
	  url: `${process.env.VUE_APP_BEG_IP}xboot/hkAssessmentIndex/getAll`,
    method: 'get'

  })
}
// 表单项管理指标项提交
export function guanlitijiao(params) {
  return javaService({
	  url: `${process.env.VUE_APP_BEG_IP}xboot/hkFormIndex/relationIndex`,
    method: 'put',
    params

  })
}
// 表单编辑
export function changefrom(data) {
  return javaService({
	  url: `${process.env.VUE_APP_BEG_IP}xboot/hkFormEntity/update`,
    method: 'post',
    data: handel(data)

  })
}

// 这个设置自定义减分表单项
export function setCustomDeleteFormIndex(params) {
  return javaService({
	  url: `${process.env.VUE_APP_BEG_IP}xboot/hkFormIndex/setCustomDeleteFormIndex`,
    method: 'post',
    params
  })
}
// 这个设置自定义加分表单项
export function setCustomAddFormIndex(params) {
  return javaService({
	  url: `${process.env.VUE_APP_BEG_IP}xboot/hkFormIndex/setCustomAddFormIndex`,
    method: 'post',
    params
  })
}
// 修改表单项 保存
export function saveItem(data) {
  return javaService({
	  url: `${process.env.VUE_APP_BEG_IP}xboot/hkFormIndex/updateFormIndex`,
    method: 'put',
    data: handel(data)

  })
}
// 新建表单 搜索指标项
export function newsearchItem(params) {
  return javaService({
    url: `${process.env.VUE_APP_BEG_IP}xboot/hkFormIndex/hkFormIndexAll`,
    method: 'GET',
    params

  })
}
// 新建表单验证
export function formverification(params) {
  return javaService({
    url: `${process.env.VUE_APP_BEG_IP}xboot/hkFormEntity/addVerify`,
    method: 'GET',
    params
  })
}
// 修改表单验证
export function changeverification(params) {
  return javaService({
    url: `${process.env.VUE_APP_BEG_IP}xboot/hkFormEntity/updateVerify`,
    method: 'GET',
    params
  })
}
// 活动列表查询
export function activitylistquery(params) {
  return javaService({
    url: `${process.env.VUE_APP_BEG_IP}xboot/hkAssessmentInfo/getHkAssessmentInfoAndFlow`,
    method: 'GET',
    params
  })
}
// 活动列表查询
export function getHkOvertimeInfoAndFlow(params) {
  return javaService({
    url: `${process.env.VUE_APP_BEG_IP}performance/hkOvertimeInfo/getHkOvertimeInfoAndFlow`,
    method: 'GET',
    params
  })
}
// 部门查询
export function departmentlist() {
  return javaService({
    url: `${process.env.VUE_APP_BEG_IP}xboot/hontDepartment/getAllTeamList`,
    method: 'GET'
  })
}
// 岗位列表查询
export function postlist() {
  return javaService({
    url: `${process.env.VUE_APP_BEG_IP}xboot/hontPost/getAllList`,
    method: 'GET'
  })
}
// 导出文件
export function exportfile(params) {
  return javaService({
    url: `${process.env.VUE_APP_BEG_IP}xboot/report/testhh/download`,
    method: 'GET',
    params,
    responseType: 'blob'

  })
}
// 活动列表 详情
export function eventdetails(params) {
  return javaService({
    url: `${process.env.VUE_APP_BEG_IP}xboot/hkAssessmentInfo/getHkAssessmentScoreDetial`,
    method: 'GET',
    params
  })
}
// 加班活动详情
export function getHkOvertimeDetial(params) {
  return javaService({
    url: `${process.env.VUE_APP_BEG_IP}performance/hkOvertimeDetail/getHkOvertimeDetial`,
    method: 'GET',
    params
  })
}
// 历史审批
export function historicalapproval(params) {
  return javaService({
	  url: `${process.env.VUE_APP_BEG_IP}xboot/hkAssessmentInfo/getItemScoreAndCommentHistory`,
    method: 'GET',
    params
  })
}
// 导出查询
export function scearchdaochu(params) {
  return javaService({
    url: `${process.env.VUE_APP_BEG_IP}xboot/report/byDepartmentId`,
    method: 'GET',
    params
  })
}

